<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>{$eju.field.seo_title}</title>
  <meta name="renderer" content="webkit" />
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=0,minimal-ui" />
  <meta name="description" content="{$eju.field.seo_description}" />
  <meta name="keywords" content="{$eju.field.seo_keywords}" />
  <link href="{eju:global name='web_cmspath' /}/favicon.ico" rel="shortcut icon" type="image/x-icon" />
  {eju:static file="skin/css/public.css" /}
  {eju:static file="skin/css/iconfont.css" /}
  {eju:static file="skin/css/kft_detail.css" /}
  {eju:static file="skin/css/kft_right.css" /}

  {eju:static file="skin/js/jquery.min.1.7.2.js" /}
  {eju:static file="skin/js/top_footer.js" /}
  {eju:static file="skin/js/jquery.ajax.form.js" /}

  <script type="text/javascript">
  function showTime(tuanid, time_distance) {
  	this.tuanid = tuanid;
  	//PHP时间是秒，JS时间是微秒
      var timestamp = (new Date()).getTime();
      this.time_distance = time_distance * 1000 - timestamp;
  }
  showTime.prototype.setTimeShow = function () {
  	var timer = $("#lefttime_" + this.tuanid);
  	var btn_baoming = $("#btn_baoming_" + this.tuanid);
  	var str_time;
  	var int_day, int_hour, int_minute, int_second;
  	time_distance = this.time_distance;
  	this.time_distance = this.time_distance - 1000;
  	if (time_distance > 0) {
  		int_day = Math.floor(time_distance / 86400000);
  		time_distance -= int_day * 86400000;
  		int_hour = Math.floor(time_distance / 3600000);
  		time_distance -= int_hour * 3600000;
  		int_minute = Math.floor(time_distance / 60000);
  		time_distance -= int_minute * 60000;
  		int_second = Math.floor(time_distance / 1000);
  		if (int_hour < 10)
  			int_hour = "0" + int_hour;
  		if (int_minute < 10)
  			int_minute = "0" + int_minute;
  		if (int_second < 10)
  			int_second = "0" + int_second;
  		str_time = "<i class='iconfont af-icon-time'></i>距离报名结束还有<em class='data-day'>"+int_day + "</em>天<em class='data-hour'>" + int_hour + "</em>小时<em class='data-minute'>" + int_minute + "</em>分钟<em class='data-sec'>" + int_second + "</em>秒";
  		timer.html(str_time);
  		var self = this;
  		setTimeout(function () { self.setTimeShow(); }, 1000); //D:正确
  	} else {
  		btn_baoming.html("报名结束");
          btn_baoming.prop("class","btn-end right");
  		timer.text("结束");
  		$("#submit2").attr("class","end-btn");
  		$("#submit2").attr("disabled","disabled");
  		$("#submit2").val("报名结束");
  		return;
  	}
  }
  </script>
</head>
<body>
{eju:include file="header.htm" /}

<div class="kft-main">
  <div class="kft-detail left">
    {eju:arcview aid="$eju.field.joinaid" addfields="discount" id="view"}
    <div class="detail-wrap">
      <div class="detail-img left">
        <a target="_blank" href="{$view.arcurl}">
         <img src="{$eju.field.litpic}" width="390" height="300"/>
        </a>
      </div>
      <div class="detail-info right">
        <div class="detail-head">
          <a target="_blank" href="{$view.arcurl}">
            <h3>{$eju.field.title}</h3>
          </a>
          <span>已有{$eju.field.apply_num}人报名</span>
        </div>
        {eju:notempty name="$view.is_discount"}
        <p class="detail-dg">[优惠]{$view.discount}</p>
        {/eju:notempty}
        <p class="detail-dz">地址：{$view.address}</p>
        <div class="detail-data">
          <p id="lefttime_1"></p>
          <p>活动时间：{$eju.field.begin_time|myDate="Y年m月d日",###}-{$eju.field.end_time|myDate="Y年m月d日",###}</p>
        </div>
        <div class="detail-btn">
          <a class="btn-inxq left" target="_blank" href="{$view.arcurl}">点击进入楼盘详情页></a>
          <a id="btn_baoming_1" class="btn-ljbm dialog right" href="javascript:;" data-uri="{eju:diyurl type='form' /}">立即报名</a>
          <script type="text/javascript">
              var st = new showTime(1,"{$eju.field.end_time}");
              st.setTimeShow();
          </script>
          <div class="clear"></div>
        </div>
      </div>
      <div class="clear"></div>
    </div>
    {/eju:arcview}
    <div class="detail-main">
      {$eju.field.content}
    </div>
  </div>
  {eju:include file="right_tuan.htm"/}
  <div class="clear"></div>
</div>
{eju:include file="footer.htm"/}
{eju:static file="skin/js/carousel.min.js" /}
{eju:static file="skin/layer/layer.min.js" /}

<script type="text/javascript">
//立即报名
$(function() {
    $(".detail_slide").thumbnailImg({
        large_elem : ".large_box",
        small_elem : ".small_list",
        left_btn : ".left_btn",
        right_btn : ".right_btn"
    });
    $('.dialog').bind('click',function(){
        var url = $(this).data('uri');
        $.layer({
                type: 2,
                shadeClose: true,  
                title: false,  
                closeBtn: [1, true],  
                shade: [0.8, '#000'],  
                border: [0],  
                area: ['500px', '330px'],
                offset: ['165px',''],  
                iframe: {src: url}  
            }); 
        $(".xubox_close").click(function(){
       			$(".xubox_layer,.xubox_shade").remove();
       		});
    });
});
</script>
</body>
</html>